package com.ruoyi.common.entity.dto;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 分类 DTO 用于创建和更新
 */

@Data
public class CategoryDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id; // 仅在更新时使用


    @NotBlank(message = "分类名称不能为空")
    @Size(max = 100, message = "分类名称长度不能超过100个字符")
    private String title;


    @NotBlank(message = "分类图标URL不能为空")
    @Size(max = 512, message = "分类图标URL长度不能超过512个字符")
    private String icon;


    @NotNull(message = "排序字段不能为空")
    private Integer sortOrder = 0;


    @NotNull(message = "是否启用状态不能为空")
    private Integer isActive;
}